package com.imooc.miaosha.dao;

import com.imooc.miaosha.pojo.MiaoshaOrder;
import com.imooc.miaosha.pojo.OrderInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

import javax.annotation.security.PermitAll;
import java.util.List;

@Component("miaoshaOrderMapper")
public interface MiaoshaOrderMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MiaoshaOrder record);

    int insertSelective(MiaoshaOrder record);

    MiaoshaOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MiaoshaOrder record);

    int updateByPrimaryKey(MiaoshaOrder record);

    MiaoshaOrder getMiaoShaOrderByUserIdAndMiaoShaId(@Param("userId") Long userId,@Param("miaoshaId") Long miaoshaId);
    int countSecondKillBySecondKillId(@Param("secondKillId") Long secondKillId,@Param("status")Integer status);
    int countSecondKillByUserIdAndSecondKillId(@Param("userId") Long userId,@Param("secondKillId") Long secondKillId);
List<MiaoshaOrder>getMiaoshaOrderListByUserId(Long userId);
MiaoshaOrder getMiaosShaOrderByUserIdAndOrderId(@Param("userId")Long userId,@Param("orderId")Long orderId);
    MiaoshaOrder getOrderInfoByUserIdAndMiaoshaId(@Param("miaoshaId") Long miaoshaId, @Param("userId") Long userId);
    int getOrderCountByUserId(@Param("userId") Long userId);
}